<div id="welcome">
  <strong style="font-size:130%">
  Welcome to Musically Noted,
  </strong><br />

  the one stop spot for music, that anyone can edit.<br />
  <%=h @artist_count %> Artists, <%=h @release_count %> Releases, 
  <%=h @song_count %> Songs and growing
</div>

<div id="home_main">
<div id="artist_feature">
  <h3>Artist Spotlight</h3>
  <strong><%= link_to @random_artist.name, @random_artist %></strong><br />

  <span style="font-size:80%">
     Year-Year
    <br />

     Country
    <br />
  </span>

  <% if @random_artist.bio %>
    <hr />
    <%= truncate(simple_format(@random_artist.bio), :length => 600) %>
  <% end %>

</div>

<div id="latest_review">
  <h3>What Others Are Reviewing</h3>
  <%= link_to @random_review.reviewable, @random_review.reviewable %><br />

  <strong>  
  <%=h @random_review.title %><br />
  by: <%=h @random_review.user.username %><br />
  </strong>
  <%=h @random_review.review %>
</div>

<div id="on_this_day">
  <strong style="font-size:110%">On This Day</strong><br /><br />
  <div class="born_on_this_day">

    <strong>Born Today</strong>
    <br />

    <% if @born_today.empty? %>
      <br />
      No one was born today. Know someone born today?
      Sign in and add their birthdate!
    <% end %>

    <% @born_today.each do |artist| %>
      <div class="born_artist">
        <% if artist.images.empty? %>
          <img src="/images/REDUX.jpg" alt="Art" width="50" height="50" />
        <% else %>
          <%= image_tag artist.images.first.image.url(:small) %>
        <% end %>
        <%= link_to artist.name, artist_path(artist) %><br />
        <%=h artist.formdate_year %>
      </div>
      <hr />
    <% end %>

  </div>

  <div class="released_on_this_day">

  </div>
</div>
</div>

<div id="home_side">
<div id="new_releases">
  <strong>New Releases</strong>
  <br />

  <% if @new_releases.empty? %>
    <br />
    No new releases.
  <% end %>

  <% @new_releases.each do |edition| %>

    <div class="home_edition">
      <% if edition.images.empty? %>
        <img src="/images/REDUX.jpg" alt="Art" width="50" height="50" />
      <% else %>
        <%= image_tag edition.images.first.image.url(:small) %>
      <% end %>
      <%= link_to edition.title, release_edition_path(edition.release, edition) %><br />
      by: <%= link_to edition.release.artists.first, artist_path(edition.release.artists.first) %><br />
    </div>

  <% end %>
</div>

<div id="recent_edits">
  <h3>Latest Edits</h3>
  <% @recent_edits.each do |edit| %>

    <% next if edit.is_delete? %>

    <div class="home_edit">
      <% if edit.editable.primary_image.nil? %>
        <img src="/images/REDUX.jpg" alt="Art" width="50" height="50" />
      <% else %>
        <%= image_tag edit.editable.primary_image.url(:small) %>
      <% end %>
      <%= link_to edit.editable, edit.editable %><br />
      by: <%=h edit.user.username %><br />
    </div>

  <% end %>
</div>
</div>
